<?php
namespace app\admin\middleware;

use think\facade\Request;
use think\facade\Session;

class AdminCheck
{
    public function handle($request, \Closure $next)
    {
        $admin_info = session('admin_info');
        if (empty($admin_info)) {

            return redirect('/admin/auth/login');
        }else{
            $request->admin_info = $admin_info;
        }
        return $next($request);
    }
}